﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HotelManagement.Class;

namespace HotelManagement.UserManagementModule
{
    public partial class DeleteMyAccount : System.Web.UI.Page
    {
        UserAccount us;
        protected void Page_Load(object sender, EventArgs e)
        {
            us=(UserAccount)Session["object"];
            Label3.Text = us.FirstName + " " + us.LastName;
        }

        protected void Button2_Click(object sender, EventArgs e) //delete button
        {
            
            if (HotelDBManager.deleteAccountByID(us.UserID) == 1)
            { //delete success
                Response.Redirect("~/UserManagementModule/DeleteAccountSuccess.aspx");
            }
            else {  //delete fail
                Label5.Visible = true;
            }
        }
    }
}